package com.example.demo.listener;

import com.example.demo.constants.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkListener {
//    要监听的队列
    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queueListener(Message message){
        System.out.println("["+Constants.WORK_QUEUE+"] 接收到的消息:"+message);
    }
}
